"""
Created on 12 mrt. 2012

@author: Daan
"""

import SimpleXMLRPCServer

class RequestHandler(SimpleXMLRPCServer.SimpleXMLRPCRequestHandler):
    """
    DOCSTRING
    """

    rpc_paths = ('/RPC2',)

def xmlrpcserver(host, port, shutdown_cb, timeout = 0.01):
    """
    DOCSTRING
    """

    server = SimpleXMLRPCServer.SimpleXMLRPCServer((host, port), requestHandler=RequestHandler)

    server.timeout = timeout

    server.register_introspection_functions()

    server.register_function(shutdown_cb, "shutdown")

    return server
